package com.heima.wemedia.controller.v1;

import com.heima.model.article.dtos.DateDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据统计的控制器
 * @author lwh
 * @create 2021-10-12
 */
@RestController
@RequestMapping("/api/v1/statistics")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;
    @PostMapping("/news")
    public ResponseResult news(@RequestBody DateDto dto){
        return statisticsService.news(dto.getStime(),dto.getEtime());
    }
}
